package com.bgs.controller;

import com.bgs.pojo.Achievements;
import com.bgs.service.AchievementsService;
import com.bgs.tool.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/achievements")
public class AchievementsController {
    @Autowired
    private AchievementsService achievementsService;
    //查询所有考核计划
    @GetMapping("/select")
    public R select(Integer eid){
        return achievementsService.select(eid);
    }
    //查询已完成的
    @GetMapping("/finish")
    public R finish(Integer eid){
        return achievementsService.finish(eid);
    }
    //查询未完成的
    @GetMapping("/undone")
    public R undone(Integer eid){
        return achievementsService.undone(eid);
    }
    //根据aid查询具体考核计划
    @GetMapping("/getByid")
    public R getByid (Integer aid){
        return  achievementsService.getByid(aid);
    }
    //评语功能
    @PostMapping("/comment")
    public R comment(@RequestBody Achievements achievements){
        return achievementsService.comment(achievements);
    }
}
